/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */
package questao01.log;

/**
 *
 * @author SDKW
 */
public class Logger {

    private boolean ativo = false;
    private static Logger logger = null;
    
    public static Logger getInstance() {
        if (logger == null) {
            logger = new Logger();
        }
        return logger;
    } 

    protected Logger() {}

    public boolean isAtivo() {
        return this.ativo;
    }

    public void setAtivo(boolean b) {
        this.ativo = b;
    }

    public void log(String s) {
        if(this.ativo) {
            System.out.println("LOG :: " + s);
        }
    }

}
